<?php
    $device_sn = $_GET['device'];
    $pdo = new PDO('mysql:host=localhost;dbname=device_binding','root','zqVnUy6cxsQXbpEZ');
    $pdo->exec('set names utf8');
    $old_pdo = new PDO('mysql:host=localhost;dbname=wx_online_movie','root','zqVnUy6cxsQXbpEZ');
    $old_pdo->exec('set names utf8');
    $sql = "DELETE FROM binding WHERE device_sn = '".$device_sn."'";
    $old_sql = "DELETE FROM weixin_binging WHERE deviceSelf = '".$device_sn."'";
    $old_res = $old_pdo->exec($old_sql);
    $res = $pdo->exec($sql);
    if ($res || $old_res) {
        echo 1;
    }else{
        echo 1;
    }
 ?>
